@extends('layouts.back_stage')
@section('content')
  <style>
  /* .container{background:#fff;margin-top:30px} */
  #app{padding:20px}
  [v-cloak] {display: none;}
  .table_margin{padding:30px;background:#fff;margin-top:10px}
  .touching{margin-left:10px;float:right}
  .but{margin-right:10px;overflow: hidden;}
  .ingred_sel{width:250px;margin:0 30px 0 10px}
  </style>
  <div class="container">
      <div style="padding:20px 20px 20px 0;overflow:hidden;"><h3 style="float:left;">包码管理</h3></div>
      <div class="row app" id="app" v-cloak>
        <div class="but">
            <el-button type="primary" class="touching" @click="addDeliver" size="small">生成</el-button>
        </div>    
        <div class="table_margin">
            <div>
            <label>单包件数：</label>
                    <el-input  class="ingred_sel "   v-model="input_a" size="small" placeholder="请输入1-20位单包件数：" clearable></el-input>
            </div>
            <div  style="margin-top:20px">
            <label>打印数量：</label>
                    <el-input  class="ingred_sel" v-model="input_b" size="small" placeholder="请输入1-20位打印数量：" clearable></el-input>
            </div>  
        </div>
      
      </div>
  </div>
 
  <script>
      const App=new Vue({
        el: '#app',
        data() {
          return {
            input_a:'',
            input_b:'',
          }
        },
        methods: {
            addDeliver(){
                var moder=/^(?:[1-9]|1[0-9]|20)$/ 
                 if(!moder.test(this.input_a)){
                    this.$notify.error({
                        title: '提示',
                        message: '请填写正确的数字',
                    });
                    return false;    
                  }
                  var num=/^(?:[1-9]|1[0-9]|20)$/ 
                 if(!num.test(this.input_b)){
                    this.$notify.error({
                        title: '提示',
                        message: '请填写正确的数字',
                    });
                    return false;    
                  }
                window.location.href =`/packs/print/?input_a=${this.input_a}&input_b=${this.input_b}`;
            },
          },
     mounted() {
          
          },
      })
  </script>
@endsection